package log;

import java.io.*;

public class Logger {
	public static void info(String preName, String content) {
		try {
			String name = preName + "_Info.txt";
			BufferedWriter fileBw = new BufferedWriter(new FileWriter(name, true));
			fileBw.write("[Info]" + content + "\r\n");
			fileBw.close();
		} catch(IOException ioEx) {
			System.err.println(ioEx.getMessage());
			ioEx.printStackTrace();
		}
	}
	
	public static void warn(String preName, String content) {
		try {
			String name = preName + "_Warning.txt";
			BufferedWriter fileBw = new BufferedWriter(new FileWriter(name, true));
			fileBw.write("[Warning]" + content + "\r\n");
			fileBw.close();
		} catch(IOException ioEx) {
			System.err.println(ioEx.getMessage());
			ioEx.printStackTrace();
		}
	}
	
	public static void error(String preName, String content) {
		try {
			String name = preName + "_Error.txt";
			BufferedWriter fileBw = new BufferedWriter(new FileWriter(name, true));
			fileBw.write("[Error]" + content + "\r\n");
			fileBw.close();
		} catch(IOException ioEx) {
			System.err.println(ioEx.getMessage());
			ioEx.printStackTrace();
		}
	}
}
